package com.hqd.ch03.v34.web.servlet.mvc.condition;

import javax.servlet.http.HttpServletRequest;

/**
 * 请求条件接口
 *
 * @param <T>
 */
public interface RequestCondition<T> {

    /**
     * 组合多种条件
     *
     * @param other
     * @return
     */
    T combine(T other);

    /**
     * 是否符合条件
     *
     * @param request
     * @return
     */
    T getMatchingCondition(HttpServletRequest request);

    /**
     * 比较优先级
     *
     * @param other
     * @param request
     * @return
     */
    int compareTo(T other, HttpServletRequest request);
}
